class Food{
    element:HTMLElement

    constructor(){
        this.element = document.getElementById('food')!
    }

    get X(){
        return this.element.offsetLeft
    }

    get Y(){
        return this.element.offsetTop
    }

    set X(value:number){
        this.element.style.left = value + 'px'
    }

    set Y(value:number){
        this.element.style.top = value + 'px'
    }

    change(){
        //0<=Math.random()<1
        this.X = Math.round(Math.random()*46)*10
        this.Y = Math.round(Math.random()*49)*10
        
        
        
    }


}

export default Food